<template>
  <div class="set-package">
    <!-- 顶部按钮 -->
    <top-button/>
    <div class="main-wrap">
      <!-- tabs选择 -->
      <el-tabs v-model="activeName">
        <el-tab-pane label="信息录入" name="1">
          <push-message :assets="assetsForm"/>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
import topButton from '../components/setpackage/topbutton'
import indentManage from '../components/setpackage/indent'
import pushMessage from '../components/setpackage/pushmessage'
import organizationManage from '../components/setpackage/organization'
export default {
  components: {
    topButton,
    pushMessage,
    indentManage,
    organizationManage
  },
  data() {
    return {
      activeName: '1'
    }
  },
  created() {
    this.getAssetsFormData()
  },
  methods: {
    getAssetsFormData() {
      if (this.$route.params.id) {
        this.assetsForm = this.$route.params
        if (this.assetsForm.validityTimeType === 'times') {
          const daterange = []
          daterange.push(this.assetsForm.startTime)
          daterange.push(this.assetsForm.endTime)
          this.assetsForm.daterange = daterange
        }
        this.assetsForm.discountPrice = parseInt(this.assetsForm.originPrice) - parseInt(this.assetsForm.price)
      }
    }
  }
}
</script>

<style lang="scss" >
.set-package {
  .main-wrap {
    padding: 22px 20px;
    .el-tabs__item {
      font-size: 18px;
    }
  }
}
</style>
